package com.yc.baseProgram.recursion;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * description:
 * author: yc
 * date: 2021/2/23 20:48
 */
public class C1 {


    public static void fn(List<String[]> list, String[] arr, String str) {
        //迭代list
        List<String> li = new ArrayList<String>();
        for (int i = 0; i < list.size(); i++) {
            //取得当前的数组
            if (i == list.indexOf(arr)) {
                //迭代数组
                System.out.println(arr.length);
                for (String st : arr) {
                    st = str + st;
                    if (i < list.size() - 1) {
                        fn(list, list.get(i + 1), st);
                    } else if (i == list.size() - 1) {
                        li.add(st);
                    }
                }
            }
        }
        for (int i = 0; i < li.size(); i++) {
            System.out.println(li.get(i));
        }
    }

    public static void main(String[] args) {
        String[] a1 = {"1","2","3"};
        String[] a2 = {"a","b","c"};
        String[] a3 = {"%","@","$"};
        List<String[]> list = new ArrayList<>(3);
        list.add(a1);
        list.add(a2);
        list.add(a3);

        fn(list, new String[0], "");
    }


}
